﻿using System.Text;

namespace FX.CC.Andon.Utility.Common
{
    /// <summary>
    /// 系统参数配置类
    /// </summary>
    public class SysParam
    {
        #region 错误提示
        /// <summary>
        /// 错误页面提示
        /// </summary>
        /// <param name="tag">提示标记</param>
        public static string ErrorPageTip(string tag)
        {
            string response = string.Empty;
            switch (tag)
            {
                #region common
                case "0":
                    response = "网路延迟，刷新重试下";
                    break;
                case "1":
                    response = "URL解析错误";
                    break;
                case "2":
                    response = "您无权限访问该页面";
                    break;
                case "3":
                    response = "表单或地址栏中含有尝试注入的非法关键词";
                    break;
                case "4":
                    response = "此ip地址已被禁止授权访问";
                    break;
                case "5":
                    response = "非正常操作";
                    break;
                case "6":
                    response = "盗链请求";
                    break;
                case "7":
                    response = "服务器未接受到页面请求";
                    break;
                #endregion

                #region admin login
                case "8":
                    response = "您输入的账号不存在";
                    break;
                case "9":
                    response = "您输入的密码有误";
                    break;
                case "10":
                    response = "恭喜您登陆成功";
                    break;
                case "11":
                    response = "此账号已被冻结，请与管理员联系";
                    break;
                case "12":
                    response = "此账号已被禁用，请与管理员联系";
                    break;
                case "13":
                    response = "亲爱的会员同志，您尚未登录";
                    break;
                case "14":
                    response = "您的系统身份不合法，请与管理员联系";
                    break;
                case "15":
                    response = "验证码输入错误，请重新填写";
                    break;
                #endregion

                #region tip
                case "16":
                    response = "请确认所填信息的完整性";
                    break;

                #endregion

                #region site message
                case "17":
                    response = "站内信获取失败，请刷新重试";
                    break;
                #endregion
            }

            return response;
        }
        #endregion

        /// <summary>
        /// 用户密码加密
        /// </summary>
        /// <param name="paramStr">待加密的字符串</param>
        /// <returns>加密后的字符串</returns>
        public static string EncryptAdmin(string paramStr)
        {
            return EncryptPassWord.ConvertStringToBase64String(paramStr, Encoding.UTF8);
        }
    }
}
